package com.sx.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.sx.utils.SnowflakeIdWorker;
import org.springframework.stereotype.Component;

/**
 * @author AdinZ
 * @date 2020/5/26 14:59
 */
@Component
public class IdGenerator  implements IdentifierGenerator {
    @Override
    public Number nextId(Object entity) {
        return SnowflakeIdWorker.generateId();
    }
}
